import {createRouter, createWebHistory} from "vue-router";
import Home from "../views/Home.vue";
import Login from "../views/Login.vue";
import Seller from "../components/seller/seller.vue";
import Rating from "../components/rating/rating.vue";
import Goods from "../components/goods/goods.vue";

const routes = [
  {
    path: "/", redirect: "/home/goods"
  },
  {
    path: "/home", name: "home", component: Home,
    children: [
      {
        path: "seller", name: "seller", component: Seller
      },
      {
        path: "goods", name: "foods", component: Goods
      },
      {
        path: "rating", name: "rating", component: Rating
      }
    ]
  },
  {
    path: "/login", name: "login", component: Login
  }
]
const rooter = createRouter({
  history: createWebHistory(),
  routes
});

export default rooter;